<div class="main-wrap" style="opacity: 1;">

    <div class="order customer-order-view">
        <!--begin map-->
        <div class="map">
            <a class="index" href="/index/goods/index.html">首页</a>&nbsp;&gt;&nbsp;<a href="/index/goods/order.html">订单</a>&nbsp;&gt;&nbsp;订货单详情
        </div>
        <!--end map-->
        <ul class="ui-tab-menu">
            <li class="current"><a href="{:url('',array('ids'=>$order.id))}">订单详情</a></li>
            <li><a href="/old/order/order?action=queryLogistics&amp;orderNum=DH-O-20190104-254133">出库/发货记录</a></li>

        </ul>
        <div class="main-t">

            <div class="box-status">
                <div class="box-yellow">
                    <div class="customer-order-status-1">
                        订单号：
                        <div class="wrap-seckill">{$order.nb}</div>
                        &nbsp;状态：<span class="green">待订单审核</span>
                    </div>
                    <div class="customer-order-status-2">
                        尊敬的客户，您的订单
                        正在订单审核，请您耐心等待
                    </div>
                </div>
            </div>
            <div class="box-step">
                <div class="order-step">
                    <div class="order-step-item current">提交订单</div>
                    <div class="order-step-item {$order.deliverystatus >= 1 ? 'current' : ''}"><span>订单审核</span></div>
                    <div class="order-step-item"><span>财务审核</span></div>
                    <div class="order-step-item"><span>出库审核</span></div>
                    <div class="order-step-item"><span>发货确认</span></div>
                    <div class="order-step-item "><span>完成</span></div>
                </div>
            </div>
            <!--<div class="box-op">
                <div class="control-box">
                    <div class="control-input">
                        <a class="ml10 theme-color" id="btn-cancel" href="javascript:void(0)">
                            <em class="ui-btn-op-forbid"></em>作废
                        </a>
                        <a class="ml10 theme-color print" href="javascript:void(0)" target="blank">
                            <span class="ui-btn-print-blue-ico"></span>
                            <span class="ui-btn-txt">打印</span>
                        </a>
                    </div>
                </div>
            </div>-->
            <div class="table-wrap-lite product-list">
                <table>
                    <thead>
                    <tr>
                        <th class="tc" width="10"></th>
                        <th width="50">图</th>
                        <th class="tl" width="90">商品编码</th>
                        <th class="tl" style="min-width:100px;table-layout: fixed;">商品名称</th>
                        <th class="tr" width="100">数量</th>
                        <th class="tc" width="80">备注</th>
                    </tr>
                    </thead>
                    <tbody>
                    <span class="hidden">{$number = 0}</span>
                    {foreach name="$orderList"  item="vo"}
                        <tr>
                            <td class="tc key">
                                {$key+1}
                            </td>
                            <td class="tc image">
                                <span class="productImg60"
                                      style="background-image:url('https://resource.dinghuo123.com/images/product60x60.png');"></span>
                            </td>
                            <td class="tl">
                                <a class="serial" href="{:url('/index/goods/info',array('ids'=>$vo.preproduct_id))}"
                                   target="_blank">{$vo.b_n}</a>
                            </td>
                            <td class="tl tip_1">
                                {$vo.cname}  ({if $vo.type == 1} 半成品 {else} 成品 {/if})
                            </td>
                            <td class="tr">{$vo.num}套</td>
                            <td class="tc product-remark-td">
                                <textarea class="ui-textarea-line ui-textarea-auto inp-remark" data-orderId="{$vo.order_id}" data-preproductId="{$vo.preproduct_id}"  >{$vo.remarks}</textarea>
                            </td>
                        </tr>
                            <span class="hidden">{$number +=$vo.num}</span>
                    {/foreach}
                    </tbody>
                </table>
            </div>
            <div class="order-total">
                <div class="total-r wauto">
                    <div class="total-group clearfix">
                        <div class="fl w190 tr product-totalcount">商品数量：{$number} &nbsp;</div>
                    </div>
                </div>
            </div>
            <div class="control-box order-info">
                <div class="control-group remark">
                    <label class="control-label">填写备注：</label>
                    <div class="control-input">
                        <textarea class="ui-textarea-line ui-textarea-auto inp-remark " data-orderId="{$order.id}" name="remark" placeholder="在此填写备注信息...">{$order.remark}</textarea>
                    </div>
                </div>
                <div class="control-group address">
                    <div class="control-label">收货信息：</div>
                    <div class="control-input">
                        <div class="address-info">
                            <ul>
                                <li>
                                    <input type="hidden" class="addressId" autocomplete="off" value="{$Githouse.id}">
                                    收货人： <span class="contact">{$Githouse.lxr}</span>,&nbsp;&nbsp;
                                    联系电话：<span class="mobile">{$Githouse.mobile}</span>,&nbsp;&nbsp;
                                    收货地址：<span class="address">{$Githouse.province_text},{$Githouse.city_text},{$Githouse.area_text}{$Githouse.address}</span>
                                </li>
                            </ul>
                            <a href="javascript:void(0)" id="address-edit" data-orderId="{$order.id}" class="gray address-edit"><span
                                    class="ui-btn-edit-gray-ico"></span><span class="ui-btn-txt">修改地址</span></a>
                        </div>
                    </div>
                </div>
                <div class="control-group delivery-date">
                    <div class="control-label">制单人：</div>
                    <div class="control-input">
                        <div class="delivery-date-info">
                            {$order.userid_text}
                        </div>
                    </div>
                </div>
                <div class="control-group delivery-date">
                    <div class="control-label">交货日期：</div>
                    <div class="control-input">
                        <div class="delivery-date-info">
                            {$order.deliverydate}
                        </div>
                    </div>
                </div>
                <div class="control-group">
                    <div class="control-label">
                        <a href="javascript:void(0)" id="expandArrow" class="ui-arrow">操作日志
                            <em
                            class="ui-arrow-icon"></em></a></div>
                    <div class="control-input"></div>
                </div>
                <div class="table-wrap orderlog" style="display:block;">
                    <table>
                        <thead>
                        <tr>
                            <th class="tl" width="200">公司名称</th>
                            <th class="tc" width="100">操作人</th>
                            <th class="tl" width="150">时间</th>
                            <th class="tl">操作日志</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach name="$orderlogList" item="vo"}
                            <tr>
                                <td class="tl">{$vo.dep_name}</td>
                                <td class="tc">{$vo.username}</td>
                                <td class="tl">{:date('Y-m-d H:i:s',$vo.createtime)}</td>
                                <td class="tl">{$vo.content}</td>
                            </tr>
                        {/foreach}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="control-box btn-submit">
        <a class="ui-btn ui-btn-default cancel" href="javascript:void(0)">返回</a>
    </div>
    <input type="hidden" id="orderNum" value="DH-O-20190104-254133" autocomplete="off">
    <div class="hidden-box">
    </div>

</div>
<script>
    $(function () {
        //修改备注
        $('.inp-remark').change(function () {
          var orderId = $(this).attr('data-orderId');
          var preproductId = $(this).attr('data-preproductId');
          var remark = $(this).val();
          if(preproductId)
          {
            data = {order_id:orderId,preproduct_id:preproductId,content:remark};
          }else{
            data = {order_id:orderId,content:remark};
          }
          $.ajax({
            type: "POST",
            url:'/index/goods/remark' ,
            data:data,
            dataType: "json",
            success: function(data){
                layer.msg(data.msg);
                return false
            }
          });
        });

      $('.address-edit').on('click',function () {
        layer.open({
          type: 2,
          title: '修改收货地址',
          shadeClose: true,
          shade: 0.1,
          area: ['50%', '50%'],
          content: '/index/goods/addressEdit/ids/'+$(this).attr('data-orderId') //iframe的url
        });
      });
    })
</script>